<body>
    <div class="archives-bg"></div>
    <div class="archives-content">
        <% let years = []; posts.forEach((item) => { const year = item.date.substring(0, 4); if (!years.includes(year)) { years.push(year); } }); %>
        <% years.forEach(function(year) { %>
        <div class="archives-year"><%- year %></div>
        <ul>
            <% posts.forEach(function(post) { %>
            <%if (post.date.indexOf(year) !== -1) { %>
            <li><span></span>
                <div>
                  <a data-pjax href="<%= post.link %>" class="post">
                    <div class="archives-title"><%= post.title %></div>
                    <div class="archives-time"><%= post.dateFormat %></div>
                </a>
                    
                </div>
            </li>
            <% } %>
            <% }); %>
        </ul>
        <% }); %>
    </div>
</body>